<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ page import="java.sql.*"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=uft-8">
    
    <title>检验注册页面</title>
   

  </head>
 
  <body>
    <br>
   <%
   request.setCharacterEncoding("utf-8");
   String username=request.getParameter("username");
   String name=request.getParameter("name");
   String sex=request.getParameter("sex");
   String age=request.getParameter("age");
   String number=request.getParameter("number");
   %>
   <% 
   String driver = "com.mysql.jdbc.Driver";  
   String url = "jdbc:mysql://localhost:3306/jsp";  
   String use = "root";   
   String password = "root"; 
    Class.forName(driver);  
    Connection conn= DriverManager.getConnection(url,use,password);  
    String sql= "update tb_student set    name=?,sex=?,age=?, number=? where username=?";
	PreparedStatement ps = conn.prepareStatement(sql);		
    ps.setString(1,name);
    ps.setString(2,sex);
    ps.setString(3,age);
    ps.setString(4,number);
    ps.setString(5,username);
	ps.executeUpdate();
	ps.close();
	conn.close();
	%>
    <jsp:forward page="detailed information.jsp" />
	 </body>
	 </html>